package com.auxgroup.smarthome.vo;

import com.auxgroup.smarthome.entity.UserEntity;
import com.auxgroup.smarthome.entity.UserStatus;

/**
 * Created by kevinchen on 2017/2/22.
 */
public class UserListVo{

    private String uid;

    private String userName;

    private String realName;

    private String phone;

    private String roleId;

    private String roleName;

    private String email;

    private Long lastLoginTime;

    private String headImg;

    private Long createTime;

    private UserStatus userStatus;

    public UserListVo() {
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public UserStatus getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(UserStatus userStatus) {
        this.userStatus = userStatus;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Long getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Long lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public UserListVo(UserEntity userEntity){
        this.uid = userEntity.getId();
        this.userName = userEntity.getUserName();
        this.realName = userEntity.getRealName();
        this.phone = userEntity.getPhone();
        this.roleId = userEntity.getRole() == null? "" : userEntity.getRole().getId();
        this.roleName = userEntity.getRoleName();
        this.createTime = userEntity.getCreatedAt();
        this.userStatus = userEntity.getUserStatus();
        this.email = userEntity.getEmail();
        this.headImg = userEntity.getHeadImg();
        this.lastLoginTime = userEntity.getLastLoginTime();
    }


}
